<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta content="telephone=no" name="format-detection">
    <title>完善资料 3/4</title>
    <script src="../../../js/jquery-1.8.3.min.js"></script>
    <script src="../../../js/mobile.js"></script>
    <!-- 根据额外需求引用fix.js -->
    <script src="./js/fix.js"></script>

    <script type="text/javascript" src="js/ruler.js"></script>
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/pefect_info.css">
    <link rel="stylesheet" href="./css/ksd.css">
</head>
<script>
    $(document).ready(function () {
        var h = $(document).height(); //页面总高度
        var h1 = $(window).height(); //页面显示区域高度
        if (h <= h1) {
            // alert("页面小于一屏");
            $(".btn").css("bottom", "3%");
        }
        var storage = window.localStorage;
        if (storage.length != 0) var person = JSON.parse(storage.person_info),
            sex = person.sex,
            sex_val = sex == 1 ? 70 : 45;
        //初始化尺子2
        var measureRuler2 = new MeasureRuler({
            wrapperId: "rulerWrapper2", //容器ID，页面中写一个DIV就行 (必须)
            max: 400, //刻度尺最大的刻度    (非必须，默认为1000)
            minUnit: 1, //刻度尺最小刻度    (非必须，默认为1)
            unitSet: 10, //刻度尺单元长度    (非必须，默认是10)
            value: sex_val, //初始化数值       (非必须，默认为1)
            mult: 1, //刻度值倍数，默认是最小刻度值为10px，如果定mult为3则最小刻度为30px (非必须，默认为1)
            callback: rulerSetValue2, //滑动尺子过程中的回调函数     (非必须)
            min: 10
        });

        function rulerSetValue2(val) {
            $(".rval").html(val)
        };
        $(".btn").on("click", function () {
            var if_skip = $.trim($(".btn_weight .btn_active1").text()) == "保持塑形" || $.trim($(".btn_weight .btn_active2").text()) ==
                "保持塑形";
            var storage = window.localStorage;
            if (storage.length != 0) {
                var person = JSON.parse(storage.person_info);
                person.weight = $.trim($(".rval").text());
                storage.person_info = JSON.stringify(person);
                if_skip == true ? window.location.href = 'evaluation.html' : window.location.href = 'perfect_info4.html'
            } else {
                window.location.href = 'homepagehtml.html'
            }

        });
        $(".btn_weight").on("click", function () {
            $(this).find("div").eq(0).toggleClass("btn_active1");
            $(this).find("div").eq(1).toggleClass("btn_active2");
        });
    });
</script>

<body>
    <div class="back">
        <div class="upcore-navbar">
            <span class="upcore-navbar-icon-left" onclick="history.back(-1)"></span>
            <span class="upcore-navbar-name-span">完善资料3/4</span>
            <br style="clear:both">
        </div>
        <div class="cont cont1">
            <p class="title_font Regular">今天的体重</p>
        </div>
        <div class="cont ">
            <div class="page" data-page="profile1">
                <div class="page-main">
                    <input type="hidden" name="first_screen" value="30##150##50">
                    <div class="row">
                        <div id="box">
                            <p class="ruler2 Light"><span class="rval Medium">0</span>公斤</p>
                            <div id="rulerWrapper2"></div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="cont cont3"><span class="title_font Regular">目标</span></div>
        <div>
            <div class="btn_weight">
                <div class="btn_active1">我要减肥</div>
                <div>保持塑形</div>
            </div>
        </div>
        <div class="cont Light" style="margin:2.25rem auto 0.8rem auto;font-size: 0.24rem;color:rgb(51,51,51)">
            请放心，U+不会向任何人透露您的信息</div>
        <button class="btn">下一步</button>
    </div>
</body>

</html>